#ifndef OBPLAYER_H
#define OBPLAYER_H

#include "ObDynamic.h"

enum PLAYERSTATE
{
	SMALL = 1, BIG, FLOWER
};

class ObPlayer : public ObDynamic{
public:

	enum PLAYER { MARIO = 60};

	ObPlayer();
	ObPlayer(int nid, int ninfo);
	~ObPlayer();

	bool setId(int nid);
	bool setInfo(int ninfo);

	static bool checkType(int nid);
	static bool checkInfo(int ninfo);

	void calSprite(float dt);
	void collidedWith(ObObject* object, CollisionRS rs);
	void update(float dt);
	void render(ID3DXSprite* mSprite);

	static bool loadTexture();
	static bool releaseTexture();

	//sub
	int		getLife();
	void	setLife(int nlife);

	int		getScore();
	void	setScore(int nscore);

	bool	getIsGoD();

	Action	getCurrentAction();

	bool	getCanInput();
	void	setCanInput(bool caninput);

	void	transportByPile(float posx, float posy, float delay, D3DXVECTOR3 delayVelIn, D3DXVECTOR3 delayVelOut);
	void	getOutOfPile();

	PLAYERSTATE	getStatus();
	void		setStatus(PLAYERSTATE nstatus, bool fake = 0);

public:
	static float PLAYER_NORMAL_SPD;
	static float PLAYER_FAST_SPD;
	static float PLAYER_JUMP_SPD;
	static float PLAYER_NORMAL_X_ACCEL;
	static float PLAYER_FAST_X_ACCEL;

	bool isMapDone;
	bool canRun;
	unsigned char requestedKey;

private:
	void kill(bool perma);

	static IDirect3DTexture9* mTex;
	static IDirect3DTexture9* mBulletTex;

	static CSound* sDye;
	static CSound* sShoot;
	static CSound* sGetCoin;
	static CSound* sExtraLife;
	static CSound* sFinishMap;
	static CSound* sJump;
	static CSound* sLVUp;

	int mCurrentSprite;
	Action mCurrentAction;

	int mLife;
	int mScore;

	float isGoD;
	float isJustHitted;
	float isJustAte;

	PLAYERSTATE mStatus;
	PLAYERSTATE mFakeStatus;

	bool canInput;
	bool isBack;
	float count;
	float delaycount;
	float delayupdate;
	float jumpcount;
	float shootcount;

	float transportindelay;
	float transportoutdelay;
	float transforttox;
	float transforttoy;
	D3DXVECTOR3 transfortvel;

	int highPos;
	int farpos;
};

#endif // !OBPLAYER_H
